﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="DanhSachTieuDiem.aspx.cs"
    Inherits="QuangMobile.Admin.DanhSachTieuDiem" MasterPageFile="~/Admin/AdminSite.Master"
    MaintainScrollPositionOnPostback="true" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Quản lý danh sách bài viết</p>
    </div>
    <div class="NoiDung">
        <div class="FormThaoTac">
            <h1 id="TieuDeChuyenMuc" runat="server">
            </h1>
            <p style="width: 100%; text-align: right">
                <%--<asp:DropDownList ID="ddlPheDuyet" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="ddlPheDuyet_SelectedIndexChanged">
                    <asp:ListItem Text="--Lọc bài viết--" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="Đã phê duyệt" Value="1"></asp:ListItem>
                    <asp:ListItem Text="Chưa phê duyệt" Value="0"></asp:ListItem>
                </asp:DropDownList>--%>
            </p>
            <asp:Button ID="btnThemMoi" runat="server" Text="Đăng bài viết tiêu điểm mới" 
                CssClass="cmdBtn" onclick="btnThemMoi_Click" />
            <asp:HiddenField ID="MenuID" runat="server" />
            <asp:GridView ID="grvData" runat="server" AutoGenerateColumns="False" CssClass="ListTable FitWidth"
                OnRowEditing="grvData_RowEditing" OnRowCancelingEdit="grvData_RowCancelingEdit"
                OnRowCommand="grvData_RowCommand" OnRowDeleting="grvData_RowDeleting">
                <Columns>
                    <asp:TemplateField HeaderText="Tiêu đề bài viết">
                        <ItemTemplate>
                            <asp:HyperLink CssClass="TableLink" ID="HyperLink1" runat="server" NavigateUrl='<%# "XemTruocBaiViet.aspx?ID="+Eval("ID") %>'><%# Eval("TieuDe") %></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ảnh đại diện">
                        <ItemTemplate>
                            <asp:Image ID="ImgAnhDaiDien" ImageUrl='<%# "../"+Eval("Image") %>' runat="server"
                                Width="100px" />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Trạng thái phê duyệt">
                        <EditItemTemplate>
                            <asp:RadioButton ID="rbtPheDuyet" runat="server" Text="Đã Phê duyệt" GroupName="PheDuyet"
                                Checked='<%# Eval("IsPheDuyet").ToString().Equals("0") ? false : true %>' /><br />
                            <asp:RadioButton ID="rbtChoPheDuyet" runat="server" Text="Chưa phê duyệt" GroupName="PheDuyet"
                                Checked='<%# Eval("IsPheDuyet").ToString().Equals("0") ? true : false %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%#Eval("IsPheDuyet").ToString().Equals("1") ? "<b><font color=#445D00>Đã phê duyệt</font></b>" : "<b><font color=#CA5900>Chờ phê duyệt</font></b>"%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Số lần đọc" DataField="SoLanDoc" ReadOnly="true" />
                    <asp:BoundField HeaderText="Cập nhật lần cuối" DataField="UpdateDate" ReadOnly="true" />
                    <asp:BoundField HeaderText="Ngày phê duyệt" DataField="PheDuyetDate" ReadOnly="true" />
                    <asp:BoundField HeaderText="Người đăng tin" DataField="HoTen" ReadOnly="true" />
                    <asp:TemplateField HeaderText="Phê duyệt">
                        <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../images/061.png" ToolTip="Phe Duyệt"
                                CommandArgument='<%# Eval("ID")%>' CommandName="Edit"></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="70px"></ItemStyle>
                        <EditItemTemplate>
                            <asp:ImageButton ID="imgUpdate" runat="server" ImageUrl="../images/approval.png"
                                ToolTip="Cập nhật" CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Approve %>">
                            </asp:ImageButton>
                            <asp:ImageButton ID="imgCancel" runat="server" CommandName="Cancel" ImageUrl="../images/cancel.png"
                                CommandArgument='<%# Eval("ID") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sửa">
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="imgSua" runat="server" ImageUrl="../images/edit.gif" ToolTip="Sửa"
                                CommandArgument='<%# Eval("ID")%>' CommandName="Sua"></asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                        <ItemStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="../images/delete.png" ToolTip="Sửa"
                                CommandArgument='<%# Eval("ID")%>' CommandName="<%# QuangMobile.MyConst.Action.Delete %>"
                                OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')">
                            </asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
